import {findOrderGoods, findOrderInfo, findReceiverByOrderId} from "@/api/b2c/order";

export default {
    name: "index",
    data() {
        return {
            receiverInfo: [],
            formData: [],
            goodList: [],
        }
    },
    methods: {
        async findOrderById(row) {
            this.formData = await row
            this.goodList = await findOrderGoods(row.id)
            this.infoList = await row
            console.log(this.infoList);
        },
        //得到该订单的商品信息
        async getOrderGoods() {
            this.goodList = await findOrderGoods(this.$route.params.id)
        },
        async getReceiverInfo(){
            this.receiverInfo =  await findReceiverByOrderId(this.$route.params.id)
            console.log(this.receiverInfo)
        },
        async getOrderInfo(){
            this.formData = await findOrderInfo(this.$route.params.id)
        },
        back() {
            location.href = "/order/order"
        },
        backOut(){
            location.href="/order/orderOutStock"
        }
    },
    created() {
        this.getOrderGoods();
        this.getReceiverInfo();
        this.getOrderInfo()
    }
}